import req from '@/utils/req'
/* 手机号密码登录   手机号 密码 加密后的密码*/

// 退出登录 /logout   手机号登录规则 /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
export function gotoPhoneLogin(phone, password) {
    return req({
      url: '/login/cellphone',
      method: 'get',
      params: {
        phone,
        password
      },
    })
  }
 
  // 发送验证码 gou
export function sendRegisterCode(phone) {
    return req({
      url: '/captcha/sent',
      method: 'get',
      params: {
        phone,
      },
    })
  }

//   验证验证码 gou
export function verifyCode(phone,captcha){
    return req({
        url:"/captcha/verify",
        method:'get',
        params:{
            phone,
            captcha
        }
    })
}
  
  /* 注册 */
  export function sendRegister(captcha, phone, password, nickname) {
    return req({
      url: '/register/cellphone',
      method: 'get',
      params: {
        captcha,
        phone,
        password,
        nickname,
      },
    })
  }
   //检测手机号码是否已注册
export function gotoCheckPhone(phone) {
  return req({
    url: '/cellphone/existence/check',
    method: 'get',
    params: {
      phone
    },
  })
}